<extend name="Base/common"/>


<block name="body">
<style>
    #main-container{
        width: 880px;
    }
</style>
    <link type="text/css" rel="stylesheet" href="__PUBLIC__/js/ext/magnific/magnific-popup.css"/>
    <link href="__CSS__/weibo.css" type="text/css" rel="stylesheet"/>
    <!--微博内容列表部分-->
    <div class="weibo_middle col-md-8">
        <include file="_quickweibo"/>
        <div>
            {:hook('Advs', 'weibo_below_sendbox')}
        </div>
        <!--  筛选部分-->
        <if condition="is_login()">
            <div>
                <div id="weibo_filter" style="margin-bottom: 10px">
                    <volist name="tab_config" id="tab">
                        <a id="{$tab}" href="{:U('Weibo/Index/index',array('type'=>$tab))}">
                            <php>if($tab == 'concerned'){</php>
                            我的关注
                            <php>}elseif($tab == 'hot'){</php>
                            热门微博
                            <php>}else{</php>
                            全站动态
                            <php>}</php>
                        </a>
                    </volist>

                </div>
            </div>
            <script>
                $('#weibo_filter #{$filter_tab}').addClass('active');
            </script>
        </if>
        <!--筛选部分结束-->
        <div id="top_list">
            <volist name="top_list" id="top">
                {:W('WeiboDetail/detail',array('weibo_id'=>$top))}
            </volist>
        </div>
        <div id="weibo_list">
            <include file="loadweibo"/>
        </div>
        <div id="load_more" class="text-center text-muted" <if condition="$page neq 1">style="display:none"</if>>
        <p id="load_more_text">载入更多</p>
    </div>
    <div id="index_weibo_page" style=" <if condition='$page eq 1'>display:none</if>">
        <div class="text-right">
            {:getPagination($total_count,30)}
        </div>
    </div>
    </div>

    <!--微博内容列表部分结束-->
    <!--首页右侧部分-->
    <div class="weibo_right col-md-4">
        <!--登录后显示个人区域-->
        <if condition="is_login()">
            <div ><img class="cover" src="__IMG__/bg.jpg" style="height: 70px;width: 100%"></div>
            <div class=" user_info" style="padding: 0px;background-color: #ffffff;">
                <div class="avatar-bg">
                    <div class="headpic ">
                        <a href="{$self.space_url}" ucard="{$self.uid}">
                            <img src="{$self.avatar128}"  class="avatar-img"style="width:60px;"/>
                        </a>
                    </div>
                    <div class="clearfix " style="padding: 0px;margin-bottom:8px">
                        <div class="col-xs-12" style="text-align: center">
                        <span class="name_touxian">
                            {$self.title}
                        <a ucard="{$self.user.uid}" href="{$self.space_url}" class="user_name">{$self.nickname|htmlspecialchars}</a>

                             <if condition="$self['rank_link'][0]['num']">
                                 <volist name="self['rank_link']" id="vl">
                                     <if condition="$vl['is_show']">
                                         <img src="{$vl.logo_url}" title="{$vl.title}"  alt="{$vl.title}" style="width: 18px;height: 18px;vertical-align: middle;margin-left: 2px;"/>
                                     </if>
                                 </volist>
                                 <else/>

                             </if>
                            </span>
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('Ucenter/index/applist',array('uid'=>$self['uid'],'type'=>'weibo'))}" title="微博数">{$self.weibocount}</a><br>微博
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('Ucenter/index/fans',array('uid'=>$self['uid']))}" title="粉丝数">{$self.fans}</a><br>粉丝
                        </div>
                        <div class="col-xs-4 text-center">
                            <a href="{:U('Ucenter/index/following',array('uid'=>$self['uid']))}" title="关注数">{$self.following}</a><br>关注
                        </div>
                    </div>

                </div>
            </div>
        </if>
        <!--登录后显示个人区域部分结束-->

        <div>
            <div class="checkin">
                {:hook('checkIn')}
                {:hook('Rank')}
            </div>
            {:hook('weiboSide')}
            <!--广告位-->
            {:hook('Advs', 'weibo_below_checkrank')}
            <!--广告位end-->

            <if condition="modC('ACTIVE_USER',1)">
            {:W('TopUserList/lists',array(null,'score'.modC('ACTIVE_USER_ORDER',1).' desc','活跃用户','top',modC('ACTIVE_USER_COUNT',6)))}
            </if>
            <if condition="modC('NEWEST_USER',1)">
            {:W('UserList/lists',array(null,'id desc','最新加入','new',modC('NEWEST_USER_COUNT',6)))}
            </if>
        </div>
    </div>
    <!--首页右侧部分结束-->
</block>
<block name="script">
   <script src="__JS__/weibo.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/ext/magnific/jquery.magnific-popup.min.js"></script>
    <script>
        var SUPPORT_URL = "{:addons_url('Support://Support/doSupport')}";
        weibo.page = '{$page}';
        weibo.loadCount = 1;
        weibo.lastId = '{$list|end}';
        weibo.url = "{$loadMoreUrl}";
        $(function(){
            weibo_bind();
            //当屏幕滚动到底部时
            if (weibo.page == 1) {
                $(window).on('scroll', function () {
                    if (weibo.noMoreNextPage) {
                        return;
                    }
                    if (weibo.isLoadingWeibo) {
                        return;
                    }
                    if (weibo.isLoadMoreVisible()) {
                        weibo.loadNextPage();
                    }
                });
                $(window).trigger('scroll');
            }
        });

    </script>
</block>
